package com.hulu73.spring.ioc.io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

public abstract class AbstractResource implements Resource{

	public boolean exists() throws IOException{
		return getFile().exists();
	}

	public boolean isReadable() throws IOException{
		return true;
	}

	public File getFile() throws IOException {
		throw new FileNotFoundException(getDescription() + " cannot be resolved to absolute file path");
	}

	public boolean isOpen() {
		return false;
	}

	public long lastModified() throws IOException{
		return getFile().lastModified();
	}

	public String getFilename() throws IOException{
		return getFile().getName();
	}

	

	
	
}
